package com.cn.ycy;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * springbootapplication 告诉spring这是一个配置类 功能和application.xml一样
 */

@ImportResource(locations = {"classpath:springcontext.xml"})
@SpringBootApplication()
@EnableScheduling
public class YcyspringbootxmlApplication {

  public static void main(String[] args) {
    ConfigurableApplicationContext run = SpringApplication.run(YcyspringbootxmlApplication.class, args);
    run.addApplicationListener(new MyListener());
  }

}
